package com.zx.tfw.enums;

import java.util.HashMap;
import java.util.Map;

public enum LanguageEnum {

    Java(1, "Java"),
    Python(2, "Python"),
    Scala(3, "Scala"),
    Golang(4, "golang"),
    CorCpp(5, "C/C++"),
    JavaScript(6, "JavaScript"),
    HTML(7, "HTML"),
    Docker(8, "Docker"),
    CSS(9, "CSS"),
    Other(10, "其他");

    private static final Map<Integer, LanguageEnum> map;

    static {
        map = new HashMap<>();
        LanguageEnum[] values = LanguageEnum.values();
        for (LanguageEnum typeEnum : values) {
            map.put(typeEnum.getCode(), typeEnum);
        }
    }

    private int code;
    private String name;

    LanguageEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static Map<Integer, LanguageEnum> asMap() {
        return map;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
